package com.example.administrator.myndk;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.SurfaceView;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    // Used to load the 'native-lib' library on application startup.

    DNPlayer dnPlayer;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        SurfaceView surfaceView = findViewById(R.id.surfaceview);
        dnPlayer = new DNPlayer();
        dnPlayer.setSurfaceView(surfaceView);
        dnPlayer.setOnPrepareListener(new DNPlayer.OnPrepareListener() {
            @Override
            public void onPrepare() {
                dnPlayer.start();
            }
        });

        dnPlayer.setDataSource("rtmp://58.200.131.2:1935/livetv/cctv1");

    }

    @Override
    protected void onResume() {
        super.onResume();
        dnPlayer.prepare();
    }

    public void start(View view) {

    }

    public void stop(View view) {
    }
}
